/*
 * karehatasksendpost.h
 *
 *  Created on: Oct 1, 2011
 *      Author: anonovermind <anonovermind@gmail.com>
 */

#ifndef KAREHATASKSENDPOST_H_
#define KAREHATASKSENDPOST_H_

#include "tasks/tasksendpost.h"

namespace Wishmaster {

class KarehaAgent;
class KarehaTaskSendPost: public Wishmaster::TaskSendPost {
	Q_OBJECT
public:
	KarehaTaskSendPost(const PostDescriptor& post, const QString& captcha,
			Wishmaster2::Network::RequestManager* requestManager, const QString& msg, KarehaAgent* agent);
	virtual ~KarehaTaskSendPost();

	ThreadId threadId() const;

signals:
	void result(KarehaTaskSendPost* task, const QByteArray& data, const QString& contentType);

protected:
	virtual Wishmaster2::Network::RequestPtr makeRequest(const PostDescriptor& post, const QString& captcha,
			Wishmaster2::Network::RequestManager* requestManager);

	virtual void onRequestDone();

private:
	PostDescriptor m_post;
	QString m_captcha;
	KarehaAgent* m_agent;

	ThreadId m_threadId;
	Wishmaster2::Network::RequestPtr m_request;
};

} /* namespace Wishmaster */
#endif /* KAREHATASKSENDPOST_H_ */
